import {
  init,
  classModule,
  propsModule,
  styleModule,
  eventListenersModule,
  h
} from "snabbdom";

const patch = init([
  classModule, // 开启 classes 功能
  propsModule, // 支持传入 props
  styleModule, // 支持内联样式同时支持动画
  eventListenersModule // 添加事件监听
]);

const container = document.getElementById("container");

const myVnode = h("a", { props: { href: "https://www.baidu.com" } }, "I'll take you places!");

const myChildNode = h("div", [
  h("p", { props: { id: "mySpan" } }, "Hello"),
  h("p", { props: { id: "mySpan2" } }, "World"),
  h("ul", [
    h("li", "Item 1"),
    h("li", "Item 2")
  ])
]
);

console.log(myChildNode);


patch(container, myChildNode);